Temporary Folder
   HOME

TheInfoList



OR:

In computing, a temporary folder or temporary directory is a
directory Directory may refer to: * Directory (computing), or folder, a file system structure in which to store computer files * Directory (OpenVMS command) * Directory service, a software application for organizing information about a computer network's u ...
used to hold
temporary file A temporary file is a file created to store information temporarily, either for a program's intermediate use or for transfer to a permanent file when complete. It may be created by computer programs for a variety of purposes, such as when a program ...
s. Many
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
s and some
software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consists ...
automatically delete the contents of this directory at
bootup In computing, booting is the process of starting a computer as initiated via hardware such as a button or by a software command. After it is switched on, a computer's central processing unit (CPU) has no software in its main memory, so so ...
or at regular intervals, leaving the directory itself intact. For
security Security is protection from, or resilience against, potential harm (or other unwanted coercive change) caused by others, by restraining the freedom of others to act. Beneficiaries (technically referents) of security may be of persons and social ...
reasons, it is best for each
user Ancient Egyptian roles * User (ancient Egyptian official), an ancient Egyptian nomarch (governor) of the Eighth Dynasty * Useramen, an ancient Egyptian vizier also called "User" Other uses * User (computing), a person (or software) using an ...
to have their own temporary directory, since there has been a history of
security vulnerabilities Vulnerabilities are flaws in a computer system that weaken the overall security of the device/system. Vulnerabilities can be weaknesses in either the hardware itself, or the software that runs on the hardware. Vulnerabilities can be exploited by ...
with temporary files due to programs incorrect
file permission Most file systems include attributes of files and directories that control the ability of users to read, change, navigate, and Execution (computing), execute the contents of the file system. In some cases, menu options or functions may be made visi ...
s or
race conditions A race condition or race hazard is the condition of an electronics, software, or other system where the system's substantive behavior is dependent on the sequence or timing of other uncontrollable events. It becomes a bug when one or more of ...
. A standard procedure for
system administration A system administrator, or sysadmin, or admin is a person who is responsible for the upkeep, configuration, and reliable operation of computer systems, especially multi-user computers, such as servers. The system administrator seeks to ensu ...
is to reduce the amount of storage space used (typically, on a disk drive) by removing temporary files. In multi-user systems, this can potentially remove ''active'' files, disrupting users' activities. To avoid this, some space-reclaiming procedures remove only files which are inactive or "old" - those which have not been read or modified in several days.


Practical issues

In Unix, the /tmp directory will often be a separate
disk partition Disk partitioning or disk slicing is the creation of one or more regions on secondary storage, so that each region can be managed separately. These regions are called partitions. It is typically the first step of preparing a newly installed disk ...
. In systems with magnetic
hard disk drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
s, performance (overall system
IOPS Input/output operations per second (IOPS, pronounced ''eye-ops'') is an input/output performance measurement used to characterize computer storage devices like hard disk drives (HDD), solid state drives (SSD), and storage area networks (SAN). Lik ...
) will increase if disk-head movements from regular disk I/O are separated from the access to the temporary directory. Increasingly, memory-based solutions for the temporary directory or folder are being used, such as "
RAM disk Ram, ram, or RAM may refer to: Animals * A male sheep * Ram cichlid, a freshwater tropical fish People * Ram (given name) * Ram (surname) * Ram (director) (Ramsubramaniam), an Indian Tamil film director * RAM (musician) (born 1974), Dutch * ...
s" set up in
random-access memory Random-access memory (RAM; ) is a form of computer memory that can be read and changed in any order, typically used to store working Data (computing), data and machine code. A Random access, random-access memory device allows data items to b ...
or the shared-memory device in Linux. A
Flash Flash, flashes, or FLASH may refer to: Arts, entertainment, and media Fictional aliases * Flash (DC Comics character), several DC Comics superheroes with super speed: ** Flash (Barry Allen) ** Flash (Jay Garrick) ** Wally West, the first Kid ...
-based
solid-state drive A solid-state drive (SSD) is a solid-state storage device that uses integrated circuit assemblies to store data persistently, typically using flash memory, and functioning as secondary storage in the hierarchy of computer storage. It is ...
is less suitable as a temporary-storage device for reading and writing due to the asymmetric read/write duration and due to wear. (See
wear leveling Wear leveling (also written as wear levelling) is a technique Wear leveling techniques for flash memory systems. for prolonging the service life of some kinds of erasable computer storage media, such as flash memory, which is used in solid-state d ...
.)


Traditional locations

In
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few ope ...
and
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
, the temporary directory is set by the
environment variable An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP envi ...
or . Using the Window API, one can find the path to the temporary directory using the function, or one can obtain a path to a uniquely-named temporary file using the function. Originally, the default was , then . In the Windows XP era, the temporary directory was set per-user as , although still user-relocatable. For Windows Vista, 7, 8, and 10 the temp location has moved again to within the AppData section of the User Profile, typically User Name (). In all versions of Windows, the Temp location can be accessed, for example, in Explorer, "Run..." boxes and in an application's internal code by using or . As with other environmental variables, or is synonymous with the full path. In
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
and
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
, the global temporary directories are and .
Web browsers A web browser is application software for accessing websites. When a User (computing), user requests a web page from a particular website, the browser retrieves its Computer file, files from a web server and then displays the page on the user' ...
periodically write data to the tmp directory during page views and downloads. Typically, is for persistent files (as it may be preserved over reboots), and is for more temporary files. See Filesystem Hierarchy Standard. In addition, a user can set their
TMPDIR TMPDIR is the canonical environment variable in Unix and POSIX that should be used to specify a temporary directory for scratch space. Most Unix programs will honor this setting and use its value to denote the scratch area for temporary files ins ...
environment variable An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP envi ...
to point to a preferred directory (where the creation and modification of files is allowed). In
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
, a sandboxed application cannot use the standard Unix locations, but may use a user-specific directory whose path is provided by the function . In
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Ope ...
, and in
AmigaDOS AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file Redirection (computing), redirection. In AmigaOS 1.x, AmigaDOS is based on a TRIPOS port by ...
are used.


See also

*
Temporary file A temporary file is a file created to store information temporarily, either for a program's intermediate use or for transfer to a permanent file when complete. It may be created by computer programs for a variety of purposes, such as when a program ...
*
Temporary variable In computer programming, a temporary variable is a variable with short lifetime, usually to hold data that will soon be discarded, or before it can be placed at a more permanent memory location. Because it is short-lived, it is usually declared ...
*
tmpfs tmpfs (short for Temporary File System) is a temporary file storage paradigm implemented in many Unix-like operating systems. It is intended to appear as a mounted file system, but data is stored in volatile memory instead of a persistent storage ...
* Trash (computing)


References

{{DEFAULTSORT:Temporary folder Computer file systems File system directories